<template>
<div>
  <!-- 头 -->
  <div>
    <van-nav-bar
      title="我的消息"
      left-arrow
      @click-left="onClickLeft"
    />
  </div>
  <div class="oneF">
    <div class="oneF1" v-for="(item,index) in dataInfo" :key="index">
      <p>{{item.time}}</p>
      <div class="oneF2">
        <h3>{{item.title}}</h3>
        <p id="model">{{item.content}}~</p>
        <div @click="goTo(item.id)" v-if="item.content.length>75?true:false" class="oneFx">
          <a>查看详情</a>
        </div>
        <div class="lines">
        </div>
      </div>
    </div>
  </div>
</div>
</template>

<script>
import request from '../../../static/request.js'
import { Notify } from 'vant'

export default {
  name: 'Myinfo',
  data () {
    return {
      dataInfo:[],  // 获取用户消息
      Abol:false,
    }
  },
  created(){
    // 获取消息
    this.getInfo();
  },
  methods: {
    onClickLeft() {
      this.$router.push('member')
    },
    // 获取消息
    getInfo(){
      request({
        url: '?controller=theapi&action=user_message',
        method: 'get',
      }).then(res => {
        // this.goodsL = res.data.data;
        console.log(res)
        this.dataInfo = res.data.data;
      })
    },
    // 跳转详情
    goTo(id){
      this.$router.push({
        name: 'Result',
        params: {
          id: id
        }
      })
    },
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.oneF{
  position: absolute;
  width: 100%;
  min-height: 93%;
  background: #f7f7f7;
}
.oneF1>p{
  text-align: center;
  margin: 0.35rem 0;
}
.oneF2{
  width: 6.9rem;
  /* height: 1.5rem; */
  background: #fff;
  border-radius: 0.13rem;
  margin: 0 auto;
  padding: 0.4rem 0;
  position: relative;
}
.oneF2 h3{
  font-size: 0.28rem;
  font-weight: bold;
  margin: 0 0.4rem;
  margin-bottom: 0.3rem;
}
.oneF2 p{
  font-size: 0.25rem;
  margin:0 0.4rem;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.oneFx{
  width: 100%;
  height: 0.5rem;
  line-height: 0.8rem;
  text-align: center;
  border-top: 0.01rem solid #ccc;
  margin-top: 0.3rem;
}
.oneFx a{
  color: #f64376;
  font-size: 0.25rem;
}

</style>
